package com.tlgen.service;

import com.tlgen.mapper.LaborMapper;
import com.tlgen.model.Labor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author: tlgen
 * @Discription:
 */
@Service
public class LaborService {

    @Autowired
    LaborMapper laborMapper;

    public List<Labor> getAllLabors() {
        return laborMapper.getAllLabors();
    }

    public Integer addLabor(Labor Labor) {
        Labor.setCreateDate(new Date());
        Labor.setEnabled(true);
        return laborMapper.insertSelective(Labor);
    }

    public Integer updateLabor(Labor Labor) {
        return laborMapper.updateByPrimaryKeySelective(Labor);
    }

    public Integer deleteLaborById(Integer id) {
        return laborMapper.deleteByPrimaryKey(id);
    }

    public Integer deleteLaborByIds(Integer[] ids) {
        return laborMapper.deleteLaborByIds(ids);
    }
}
